<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>动态火焰效果</title>
  <link rel="stylesheet" href="./styles/12-fire.css">
</head>

<body>
  <div class="g-candle">
    <div class="g-body"></div>
    <div class="g-fire-box">
      <div class="g-fire">
        <div class="g-ball"></div>
        <div class="g-ball"></div>
        <div class="g-ball"></div>
        <div class="g-ball"></div>
        <div class="g-ball"></div>
        <div class="g-ball"></div>
        <div class="g-ball"></div>
        <div class="g-ball"></div>
        <div class="g-ball"></div>
        <div class="g-ball"></div>
      </div>
    </div>
  </div>

  <script>
    let str = '';
    for(i = 0; i < 200; i++) {
      str = str + '<div class="g-ball"></div>';
    }

    console.log(str);
    
    let ele = document.getElementsByClassName('g-fire')[0];
    ele.innerHTML = str;
  </script>
</body>

</html>